package utils;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.*;
import dbutil.ConnectDB;

public class AutoProcess extends TimerTask{

	@Override
	public void run() {
		this.lock();
	}
	/**************************************
	 * Method name		: lock
	 * Return type		: void
	 * Description		:khoa thao tac sau thoi gian la 1 ngay
	 * Created date		: Jun 14, 2008
	 * Author			: Honglk
	 **************************************/
	public void lock() {
		try {
			ConnectDB.connectDB();
			PreparedStatement preStat = ConnectDB.connect
					.prepareStatement("update phanquyenxoasua SET khoa='1' "
							+ " WHERE daduyet ='1'");
			preStat.executeUpdate();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
	
}
